<template>
    <div>
        <div class="header">
            <span class="search-header">搜索用户数</span>
            <svg
                t="1683799971450"
                class="icon"
                viewBox="0 0 1024 1024"
                version="1.1"
                xmlns="http://www.w3.org/2000/svg"
                p-id="2553"
                width="25"
                height="25"
            >
                <path
                    d="M536 480v192a16 16 0 0 1-16 16h-16a16 16 0 0 1-16-16V480a16 16 0 0 1 16-16h16a16 16 0 0 1 16 16z m-32-128h16a16 16 0 0 1 16 16v32a16 16 0 0 1-16 16h-16a16 16 0 0 1-16-16v-32a16 16 0 0 1 16-16z m8 448c159.056 0 288-128.944 288-288s-128.944-288-288-288-288 128.944-288 288 128.944 288 288 288z m0 48c-185.568 0-336-150.432-336-336s150.432-336 336-336 336 150.432 336 336-150.432 336-336 336z"
                    fill="#8a8a8a"
                    p-id="2554"
                ></path>
            </svg>
        </div>
        <div class="main">
            <span class="main-title">12321</span>
            <span class="main-content">
                56.67
                <svg
                    t="1683802893956"
                    class="icon"
                    viewBox="0 0 1024 1024"
                    version="1.1"
                    xmlns="http://www.w3.org/2000/svg"
                    p-id="4550"
                    width="10"
                    height="10"
                >
                    <path
                        d="M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"
                        fill="#1afa29"
                        p-id="4551"
                    ></path>
                </svg>
                <svg
                    t="1683803032062"
                    class="icon"
                    viewBox="0 0 1024 1024"
                    version="1.1"
                    xmlns="http://www.w3.org/2000/svg"
                    p-id="5619"
                    width="10"
                    height="10"
                >
                    <path
                        d="M64 320l448 448 448-448z"
                        fill="#d81e06"
                        p-id="5620"
                    ></path>
                </svg>
            </span>
        </div>
        <div class="footer">
            <div class="charts" ref="charts"></div>
        </div>
    </div>
</template>

<script>
// 引入 echarts 核心模块，核心模块提供了 echarts 使用必须要的接口
import * as echarts from "echarts"
export default {
    name: "LineCharts",
    mounted() {
        // 初始化echarts实例
        const lineCharts = echarts.init(this.$refs.charts)
        // 配置数据
        lineCharts.setOption({
            xAxis: {
                show: false,
                type: "category",
            },
            yAxis: {
                show: false,
            },
            // 系列
            series: [
                {
                    type: "line",
                    data: [10, 10, 15, 9, 20, 11, 11, 20, 15, 15, 10, 7, 9],
                    // 拐点
                    itemStyle: {
                        opacity: 0,
                    },
                    // 线条的样式
                    lineStyle: {
                        color: "dodgerblue",
                    },
                    // 填充颜色
                    areaStyle: {
                        color: {
                            type: "linear",
                            x: 0,
                            y: 0,
                            x2: 0,
                            y2: 1,
                            colorStops: [
                                {
                                    offset: 0,
                                    color: "rgba(30, 144, 255, 0.1)", // 0% 处的颜色
                                },
                                {
                                    offset: 1,
                                    color: "#fff", // 100% 处的颜色
                                },
                            ],
                            global: false, // 缺省为 false
                            opacity: 0.5,
                        },
                    },
                    smooth: true,
                },
            ],
            // 布局模式
            grid: {
                left: 0,
                top: 0,
                right: 0,
                bottom: 0,
            },
        })
    },
}
</script>

<style scoped>
.header {
    display: flex;
    align-items: center;
    color: #8a8a8a;
}
.main {
    margin: 10px 0;
}
.search-header {
    margin-right: 10px;
}
.main-title {
    font-size: 25px;
    margin-right: 25px;
}
.charts {
  width: 100%;
  height: 100px;
}
</style>